<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>ATM</title>
    <style>
        span {
            display: inline-block;
            width: 56px;
            height: 30px;
            border: 1px solid skyblue;
        }
    </style>
</head>

<body>
    <script>
        let money = 1000
        while (true) {
            let op = +prompt(`
                请选择：
                    1、存钱
                    2、取钱
                    3、查看余额
                    4、退出
            `)
            if(op===4){
                break
            }
            switch (op) {
                case 1:
                    let cun = +prompt('存钱金额')
                    money+=cun
                    break;
                case 2:
                    let qu = +prompt('取钱金额')
                    money-=qu
                    break;
                case 3:
                    alert(money)
                    break;
            
                default:
                    alert('请选择1-4')
                    break;
            }
        }
    </script>

    <!-- <script>
        for (let i = 1; i <= 9; i++) {
            for (let j = 1; j <= i; j++) {
                document.write(`<span>${j}*${i}=${i * j}</span> `)
            }
            document.write(`<br>`)
        }
    </script> -->
</body>

</html>